package com.mawujun.util;

import java.util.HashMap;

public class StateCache {
	private static HashMap<String,State> stateCache=new HashMap<String,State>();
	
	public static void addState(String key, Integer value){
		State state=new State(value);
		state.setState(value);
		state.setSchedule(0);
		stateCache.put(key, state);
	}
	public static void addState(String key, Integer value, Integer schedule){
		
		State state=new State(value);
		state.setState(value);
		state.setSchedule(schedule);
		stateCache.put(key, state);
	}
	
	public static State getState(String key){
		return stateCache.get(key);
	}
	public static State removeState(String key){
		return stateCache.remove(key);
	}

}
